package com.hw.controller;

import com.hw.utils.OssUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * @program: springboot-alibaba-sms
 * @description:
 * @author: Henry.zhang
 * @create: 2022-09-06 12:33
 */
@RestController
@RequestMapping("oss")
public class OssController {
    /*
    属性列表
    */
    @Resource
    private OssUtil ossUtil;


    @RequestMapping(value = "upload",method = RequestMethod.POST)
    public String upload(MultipartFile file){
        //上传图片到oss并获取完整的路径
        String url = ossUtil.uploadFile(file);

        return url;

    }


}
